home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7199 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.1 KB

  1. Path: qualcomm.com!usenet
  2. From: nabbasi@qualcomm.com (Nasser Abbasi)
  3. Newsgroups: comp.lang.ada,comp.lang.c++
  4. Subject: Re: on OO differnces between Ada95 and C++
  5. Date: 22 Feb 1996 06:20:52 GMT
  6. Organization: QUalcomm Inc.
  7. Message-ID: <4gh204$l7n@qualcomm.com>
  8. References: <4gbq7q$g08@qualcomm.com> <Dn4J2F.uI@bton.ac.uk>
  9. Reply-To: x!news.be.innet.net!INbe.net!usenet
  10. NNTP-Posting-Host: annex-p32.qualcomm.com
  11. X-Newsreader: WinVN 0.90.4
  12.  
  13. In article <Dn4J2F.uI@bton.ac.uk>, je@bton.ac.uk (John English) says:
  14. >
  15. >Nasser Abbasi (nabbasi@qualcomm.com) wrote:
  16. >: Lets also assume that we need to define a Money Type, defined in
  17. >: the base class Account.     
  18. >
  19. >: In Ada95 this type is defined in the package Account.ads that also
  20. >: includes the definition of the tagged record type Account (along with
  21. >: operations that act on Account type).
  22. >
  23. >: Now, In Ada95, a client that wishes to use Saving_Account type (and
  24. >: any operations on it) will "with" the Saving_Account Package.
  25.  
  26.  
  27. >
  28. >If the spec of Saving_Account has "with Account" at the beginning,
  29. >"with Saving_Account" will imply "with Account". 
  30.  
  31. I do not think this is true. That is the main reason I asked the 
  32. question in the first place. (I did not like having to "with" 
  33. a package that was allready with'ed by a package I am "withing" ).
  34.  
  35. If what you say was the case, then types defined in package "A"
  36. will be seen by clients to a package "B" where "B" has with'ed A. But
  37. it is not so. Clients of "B" must also 'with' "A" to see types defined
  38. in "A" even though "B: has allready  with'ed "A".
  39.  
  40. Thanks all for your inputs, I see 2 solutions now to this. I like the
  41. child package solution mentioned by a number of people (including
  42. John English).
  43.  
  44. I also like the fact that withing Ada packages is not transitive. when
  45. I "with" Package A, only what is in A is visible, and not every thing
  46. that in the chain of packages that A might have "withed" (unless 
  47. offcourse tagged types are involved). This way seems to give better 
  48. control of things. In C/C++ including files A.h, will also "pull" in
  49. everthing that is included by A.h to the client level and make
  50. these things visible at the client level.. 
  51.  
  52. Nasser
  53.  
  54.